package com.financing.wap.service.impl;


import java.sql.SQLException;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import com.financing.wap.dto.FpFaUserDataDTO;
import com.financing.wap.service.IFpFaUserDataService;
import com.financing.wap.util.DTOdateSetUtil;
import com.financing.wap.dao.IFpFaUserDataDao;
/**
 * fp_fa_user_data  
 * shop人员信息表 业务访问层实现类
 * @author huqiyun
 *
 */
 
@Repository("fpFaUserDataService")
public class FpFaUserDataServiceImpl implements IFpFaUserDataService{

	@Autowired
	private IFpFaUserDataDao fpFaUserDataDao;

	@Override
	public int insert(FpFaUserDataDTO fpFaUserData) throws SQLException {
		DTOdateSetUtil.setCreateInfo(fpFaUserData);
		DTOdateSetUtil.setUpdateInfo(fpFaUserData);
//		fpFaUserData.setDeleteTag(CommonStatus.DELETE_TAG_NORMAL);
		return fpFaUserDataDao.insert(fpFaUserData);
	}

	@Override
	public void update(FpFaUserDataDTO fpFaUserData) throws SQLException {
		DTOdateSetUtil.setUpdateInfo(fpFaUserData);
		fpFaUserDataDao.update(fpFaUserData);
	}

	@Override
	public void updateForce(FpFaUserDataDTO fpFaUserData) throws SQLException {
		DTOdateSetUtil.setUpdateInfo(fpFaUserData);
		fpFaUserDataDao.updateForce(fpFaUserData);
	}

	@Override
	public void delete(Integer id) throws SQLException {
		fpFaUserDataDao.delete(id);
	}
	
	@Override
	public List<FpFaUserDataDTO> queryList(FpFaUserDataDTO fpFaUserData) throws SQLException {
		return fpFaUserDataDao.queryList(fpFaUserData);
	}

	@Override
	public int queryListCount(FpFaUserDataDTO fpFaUserData) throws SQLException {
		return fpFaUserDataDao.queryListCount(fpFaUserData);
	}

	@Override
	public FpFaUserDataDTO loadById(Integer id) throws SQLException {
		return fpFaUserDataDao.loadById(id);
	}
 	@Override
	public FpFaUserDataDTO queryListGetFirst(FpFaUserDataDTO fpFaUserData)
			throws SQLException {
		 List<FpFaUserDataDTO> queryList = queryList(fpFaUserData);
		 if(queryList==null||queryList.size()==0){
			 return new FpFaUserDataDTO();
		 }
		 return queryList.get(0);
	}
}
